home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Amiga Public Domain Connection / APDC Disk #025 - Programming Languages (198x)(Amiga Public Domain Connection)(US)[m][WB].zip / APDC Disk #025 - Programming Languages (198x)(Amiga Public Domain Connection)(US)[m][WB].adf / Modula-2 / m2 / WaitForBreak.MOD < prev    next >
Text File  |  1988-03-15  |  867b  |  32 lines

  1. (********************************************************************************
  2.  
  3. Name         : WaitForBreak.MOD
  4. Version      : 1.0
  5. Purpose      : Demo for use of Breaks
  6. Author       : ms
  7. Modified     : 13.3.86  18:55  ms
  8.  
  9. ********************************************************************************)
  10.  
  11. MODULE WaitForBreak;
  12.  
  13. FROM Terminal  IMPORT Write, WriteString, WriteLn, Read;
  14. FROM AMIGADos  IMPORT Delay;
  15. FROM Breaks    IMPORT BreakFlags, DetectBreak;
  16.  
  17. BEGIN
  18.   LOOP
  19.     Delay(25);
  20.     Write('.');
  21.     IF DetectBreak(breakC) THEN
  22.       WriteString('ctrl-c detected'); WriteLn; EXIT
  23.     ELSIF DetectBreak(breakD) THEN
  24.       WriteString('ctrl-d detected'); WriteLn
  25.     ELSIF DetectBreak(breakE) THEN
  26.       WriteString('ctrl-e detected'); WriteLn
  27.     ELSIF DetectBreak(breakF) THEN
  28.       WriteString('ctrl-f detected'); WriteLn
  29.     END
  30.   END
  31. END WaitForBreak.
  32.